<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        #app {
            margin: 0 auto;
            width: 80%;
            border: black 1px solid;
            height: 100vh;
        }
    </style>
</head>

<body>
    <div id="app"></div>
</body>
<script>
    //2.直接字面量创建对象
    let person = {
        id = "1",
        username = "tom",
        age = "20",
        gender = "男",
        toSting: function () {
            return `{"id":"${id}","username":"${username}","age":"${age}"," gender":"${ gender}",}`
        }
    }
    person.username = "tom1"
    let info = person.toSting()
    app.innerHTML = info
</script>

</html>